from django_filters import rest_framework as filters

from apps.system.models import Role


class RoleFilter(filters.FilterSet):
    # like模糊查询方式
    roleName = filters.CharFilter(field_name='name', lookup_expr='contains')

    is_active = filters.BooleanFilter(field_name='is_active')

    class Meta:
        model = Role
        fields = ['name', 'is_active']
